//
//  HomeDetailViewController.m
//  CC
//
//  Created by Calvin on 4/20/15.
//  Copyright (c) 2015 Calvin. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "HomeDetailViewController.h"
#import "LeftTableView.h"
#import "RightTableView.h"

@interface HomeDetailViewController ()
{
    LeftTableView *leftTable;
    RightTableView *rightTable;
}
@end

@implementation HomeDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    float width = self.view.bounds.size.width;
    leftTable =[[LeftTableView alloc] initWithFrame:CGRectMake(0, 0, width*0.3, self.view.bounds.size.height)];
    leftTable.backgroundColor =[UIColor blueColor];
    [self.view addSubview:leftTable];
    NSLog(@"left width is %f",self.view.bounds.size.width*0.3);
    
    rightTable =[[RightTableView alloc] initWithFrame:CGRectMake(width*0.3, 0, width*0.7, self.view.bounds.size.height)];
    rightTable.backgroundColor = [UIColor greenColor];
    [self.view addSubview:rightTable];
    
    NSLog(@"Right width is %f",self.view.bounds.size.width*0.3);
    
    UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(back)];
    [self.view addGestureRecognizer:swipeGesture];
}

-(void)back
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
